﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace _201206QuanLyBanHang.ChucNang
{
    class BLL_DMLoaiKH
    {
        DataConn da;
        public BLL_DMLoaiKH()
        {
            da = new DataConn();
        }
        public DataSet getDMLoaiKH(string strsql)
        {
            return da.ExectueQueryDataset(strsql, CommandType.Text, null);
        }
        public bool insertDMLoaiKH(ref string err, int MaLoaikh, string TenLoaikh)
        {
            return da.MyExecuteNonQuery("Pro_Insert_DMLoaiKH", CommandType.StoredProcedure, ref err, new SqlParameter("@Maloaikh", MaLoaikh), new SqlParameter("@TenLoaikh", TenLoaikh));
        }
        public bool deleteDMLoaiKH(ref string err, int MaLoaiKH)
        {
            return da.MyExecuteNonQuery("Pro_Delete_DMLoaiKH", CommandType.StoredProcedure, ref err, new SqlParameter("@MaLoaikh", MaLoaiKH));
        }
        public bool updateDMLoaiKH(ref string err, int MaLoaikh, string TenLoaikh)
        {
            return da.MyExecuteNonQuery("Pro_Update_DMLoaiKH", CommandType.StoredProcedure, ref err, new SqlParameter("@MaLoaikh", MaLoaikh), new SqlParameter("@TenKV", TenLoaikh));
        }
        public object layma(ref string err, string str)
        {
            return da.lay(str, CommandType.Text, ref err);
        }
    }
}
